﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PloobsEngine.DataAquisition
{

    public enum FpsType
    {
        UpdateFps , DrawFps , AcumulatedFps
    }

    public class FpsDataFormat : DataFormat
    {
        #region DataFormat Members


        private float ufps;
        private FpsType type;

        public FpsType FpsType
        {
            get { return type; }
            set { type = value; }
        }

        public float Fps
        {
            get
            {
                switch (type)
                {
                    case FpsType.UpdateFps:
                        return ufps;
                    case FpsType.DrawFps:
                        return dfps;
                    case FpsType.AcumulatedFps:
                        return tfps;
                }
                return 0;
            }
        }

        public string FpsTypeString
        {
            get
            {
                switch (type)
                {
                    case FpsType.UpdateFps:
                        return "UpdateFps";                        
                    case FpsType.DrawFps:
                        return "DrawFps";                        
                    case FpsType.AcumulatedFps:
                        return "AcumulatedFps";                                            
                }
                return "";
            }
        }

        private float dfps;
        private float tfps;

        public float UpdateFps
        {
            get { return ufps; }
            set { ufps = value;
            if (type == FpsType.DrawFps)
                type = FpsType.AcumulatedFps;
            type = FpsType.UpdateFps;
            }
        }

        public float DrawFps
        {
            get { return dfps; }
            set { dfps = value;
            if (type == FpsType.UpdateFps)
                type = FpsType.AcumulatedFps;
            type = FpsType.DrawFps;
            }
        }

        public float TotalFps
        {
            get { return tfps; }
            set { tfps = value;
                type = FpsType.AcumulatedFps;            
            }
        }
        public DateTime TimeStamp
        {
            get { return DateTime.Now; }
        }

        #endregion
    }
}
